package com.eve.xstream;

import com.eve.xstream.node.Alipay;
import com.eve.util.JsonRevetUtils;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.Dom4JDriver;

/**
 * @author: ivan.yao<haif.yao@gmail.com>
 * @date: 17/6/17.
 */
public class XStream2JaveBeanTest {

    public static void main(String[] args) {
        XStream xStream = new XStream(new Dom4JDriver());
        xStream.processAnnotations(Alipay.class);
        xStream.ignoreUnknownElements();//忽略没有映射的元素

        Alipay alipay = (Alipay) xStream.fromXML(XmlConst.responseErrorXml2);
        System.out.println(JsonRevetUtils.beanToJson(alipay));
    }

}
